#include "header.h"

#define MM	100

/* ------------------------------------------------------------------- */
void connstat(struct node* p){
/* ------------------------------------------------------------------- */
int i, j, neigh, bin[MM], binint[MM], aveconn=0;

for(i=0;i<MM;i++) bin[i] = binint[i] = 0;

for(i=0;i<no_grid_points;i++){
	aveconn += p[i].total_conn;
	++bin[p[i].total_conn];
	if(p[i].point_type == INTERIOR) ++binint[p[i].total_conn];
	}

printf("Average connectivity = %d\n", aveconn/no_grid_points);
printf("Connectivity statistics: conn size,    interior,         all\n");
for(i=0;i<MM;i++)
	if(bin[i] != 0 || binint[i] != 0)
		printf("\t\t\t%5d %15.2f %15.2f\n", 
		 i, 100.0*binint[i]/no_grid_points, 100.0*bin[i]/no_grid_points);

}
/* ------------------------------------------------------------------- */
